Skip to main content

AddComment

Adds a comment to the current block content control. 💡 Please note that the current block content control must be in the document.

Syntax

expression.AddComment(text, author, userId);

expression - A variable that represents a ApiBlockLvlSdt class.

Parameters

NameRequired/OptionalData typeDefaultDescription
textRequiredstringThe comment text (required).
authorRequiredstringThe author's name (optional).
userIdRequiredstringThe user ID of the comment author (optional).

Returns

ApiComment

Example

This example adds comment to the block content control

let doc = Api.GetDocument();
let blockLvlSdt = Api.CreateBlockLvlSdt();
blockLvlSdt.GetContent().GetElement(0).AddText("This is a block text content control.");
doc.AddElement(0, blockLvlSdt);
blockLvlSdt.AddComment("comment", "John Smith");